From: Julien Grall Date: Thu, 15 Sep 2016 11:28:32 +0000 (+0100) Subject: xen/arm: p2m: Introduce a helper to check if an entry is a superpage X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~326 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=a48a40e92f470cb8e41dd89b3a2b61e8d7c178e4;p=xen.git xen/arm: p2m: Introduce a helper to check if an entry is a superpage Use the level and the entry to know whether an entry is a superpage. A superpage can only happen below level 3. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini Tested-by: Tamas K Lengyel --- diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index c5695efb88..02ee9c1176 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -57,6 +57,11 @@ static inline bool_t p2m_mapping(lpae_t pte) return p2m_valid(pte) && !pte.p2m.table; } +static inline bool p2m_is_superpage(lpae_t pte, unsigned int level) +{ + return (level < 3) && p2m_mapping(pte); +} + static inline void p2m_write_lock(struct p2m_domain *p2m) { write_lock(&p2m->lock);